<!DOCTYPE html>
{% load static %}
<html lang="zh-cn">
<head>
    <script type='text/javascript' src="static/fybjs/htmlAceControlShow.js"></script>
    <script>
        headLoadFile('新一代工业软件应用商店');
    </script>
    <!--付颖斌的js文件-->
    <script type='text/javascript' src="static/fybjs/httpDataTransFyb.js"></script>
    <script>
        $.ajaxSetup({data:{csrfmiddlewaretoken:'{{ csrf_token }}'}})
    </script>

</head>
<body class="no-skin">
<!--导航栏index-->
<script>
    //权限控制
    jumpURL=getAuthURL(window.location.href);
    if(jumpURL!=window.location.href){window.location.href=jumpURL;}else{};
    //加载内容
    shortCutText=['平台主页','数据聚合','情景推荐'];
    shortCutText=[];
    shortCutLiColor=['grey','purple','green'];
    shortCutHref=['#','#','https://www.baidu.com'];
    shortCutSrc=['static/ace/assets/images/avatars/platform.png','static/ace/assets/images/avatars/process.png','static/ace/assets/images/avatars/support.png'];
    navBarShowAceIndexFyb("","新一代工业软件应用商店","工业软件库","欢迎光临",shortCutText, shortCutLiColor, shortCutHref, shortCutSrc);

    var flowID='1';//流程id
</script>

<div class="main-container ace-save-state" id="main-container">
    <!--嵌入侧边栏-->
    <div class="sidebar responsive ace-save-state" id="sidebar">
        <!-- 功能按钮区域 -->
        <script>
            buttonClass=['btn btn-success','btn btn-info','btn btn-warning','btn btn-danger'];
            dataToggle=['tab','modal','modal','modal'];
            dataTarget=['#projectManagementDiv','#newProjectModal','#helpModal','#dangerModal'];
            buttonID=['','','',''];
            iClass=['ace-icon fa fa-cog','ace-icon fa fa-table','ace-icon fa fa-users','ace-icon fa fa-bell-o'];
            //leftTopNavBarControlButtonAceFyb(buttonClass, dataToggle, dataTarget, buttonID, iClass);
        </script>
        <!-- 侧边栏 -->
        <script>
            menuList=JSON.parse(getUserMenuList());
            menuActiveID=getNavBarMenuActiveId(getHtmlUrlAlone(location.href),menuList[0]['cotentDataHref'], menuList[0]['cotentMenuID'],"@");
            leftContentNavBarAceFyb(menuList[0]['titleData'], menuList[0]['titleiClass'], menuList[0]['titleHref'], menuList[0]['cotentData'], menuList[0]['contentiClass'], menuList[0]['cotentDataHref'],menuActiveID);
        </script>


    </div>
    <div class="main-content">
        <div class="main-content-inner">
            <!--嵌入面包屑-->
            <script>
                var titleBreadData=['新一代工业软件平台','#'];
                var searchString=['noshow',''];
                var otherBreadData=new Array();
                otherBreadData[0]=['系统管理','#'];
                otherBreadData[1]=['增加角色','#'];
                testID=breadCrumbsAceFyb(titleBreadData,otherBreadData, searchString);
            </script>

            <div class="page-content">
                <div class="row">
                    <div class="col-sm-6">
                        <div class="tabbable">
                            <ul class="nav nav-tabs" id="myTab">
                                <script type='text/javascript'>
                                    subContentPageAceFyb('我的APP',true,'#');
                                </script>
                            </ul>
                            <div class="tab-content" id="pageContent">
                                <!--开始写入正文-->

                                <div class="widget-main">
                                    <form class="form-horizontal" role="form">
                                <script>
                                    labelInputShowAceFyb(['角色名称：','form-roleName-1'],['text','form-roleName-1','请填入url名称','col-xs-10 col-sm-5'],['','']);
                                    labelInputShowAceFyb(['角色字符串：','form-roleStr-1'],['text','form-roleStr-1','请填入url链接','col-xs-10 col-sm-5'],['','']);
                                </script>
                                        <div class="tab-pane" id="ghi">
                                            <div id="submitButtonFyb" class="btn-group btn-group-sm" >
                                                <button type="button" class="btn btn-info" >
                                                    <span class="glyphicon glyphicon-check"></span>提交
                                                </button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <script>
                                        //写提交按钮事件
                                        var btn = document.getElementById("submitButtonFyb");
                                        btn.onclick =function(){
                                            var roleName=document.getElementById("form-roleName-1").valueOf().value;
                                            roleName=roleName.replace("'","");//去掉'符号
                                            roleName=roleName.replace('"','');//去掉"符号
                                            roleName=roleName.replace(',','');//去掉,符号
                                            var roleStr=document.getElementById("form-roleStr-1").valueOf().value;
                                            roleStr=roleStr.replace("'","");//去掉'符号
                                            roleStr=roleStr.replace('"','');//去掉"符号
                                            roleStr=roleStr.replace(',','');//去掉,符号

                                            var transUrl='dataTransferFyb';//传输数据的URL
                                            var transType='POST';
                                            var transAsync=false;//表明同步数据传输
                                            var columnName=['role_name','role_str',];
                                            var saveDataToBase=[roleName,roleStr,];
                                                var transData={
                                                    table:dbTableHead + 'role_infor',
                                                    sqlType:'insert',
                                                    column:matrixTransStringForSqlColumn(columnName),
                                                    saveData:matrixTransStringForSqlColumn(saveDataToBase),//保存数据时，需要保存的数据
                                                    userAccount:userAccount,
                                                    enterAccount:enterAccount,
                                                };
                                                insertData=dataTransferFyb(transUrl,transType,transAsync,transData,);
                                                if(insertData[0]['insert']>0 ){
                                                    alert('角色新增成功！');
                                                    window.location.href='roleList'
                                                }else if(insertData[0]['insert']==0){
                                                    alert('角色新增失败，请重新添加！');
                                                }else{}
                                        }
                                </script>


                                <!--结束写入正文-->
                                <!--测试-->

                                <!--测试结束-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--footer,显示版权信息-->
    <script>
        copyRightAceFyb('长安大学汽车学院物流工程系', 'https://qiche.chd.edu.cn/2020/1208/c8529a173474/page.htm/', '2021');
    </script>

</div>

</body>
</html>